var GameOverLayer = cc.LayerColor.extend({
    ctor: function (color) {
        this._super(color);
        this._initUI();
        this.schedule(this._changeScene, 0, 0, 2);
    },
    _initUI: function () {
        var size = cc.winSize;
        var overLabel = new cc.LabelTTF("GAME OVER", "Arial", size.width * 0.15);
        overLabel.setFontFillColor(cc.color(117, 110, 104));
        overLabel.x = size.width / 2;
        overLabel.y = size.height * 0.7;
        this.addChild(overLabel, 5);
    },
    _changeScene: function () {
        cc.director.runScene(new cc.TransitionFade(0.5, new GameScene()));
    }
});

var GameOverScene = cc.Scene.extend({
    onEnter: function () {
        this._super();
        var layer = new GameOverLayer(cc.color(251, 248, 239));
        this.addChild(layer);
    }
});

